package Finance::Pershing::StandardFiles::Store::ResultSet::SelectLink;

use strict;
use warnings;
use base 'Finance::Pershing::StandardFiles::Store::ResultSet';
use Data::Dumper;

sub coerce_and_create {
my $self = shift;
my $data = shift;

my $accounts = delete $data->{accounts};
my $item = $self->next::method($data);

print Dumper $item->detail;

$item->detail->delete_all; 
$item->detail->create({acctnum => $_}) foreach @$accounts;
return $item;
}

our %coerce_map =(
  mail_to_account => 'lead_acctnum',
  ibd_number      => 'ibd',
);

1;
